package com.huawei.hms.activity.a;

import android.text.TextUtils;
import java.util.HashMap;
import java.util.Map;

public class c {
    private static final c a = new c();
    private final Map<String, a> b = new HashMap();

    public static c a() {
        return a;
    }

    public void a(String str, a aVar) {
        if (!TextUtils.isEmpty(str) && aVar != null) {
            synchronized (this.b) {
                if (!this.b.containsKey(str)) {
                    this.b.put(str, aVar);
                }
            }
        }
    }

    public void a(String str) {
        if (!TextUtils.isEmpty(str)) {
            synchronized (this.b) {
                this.b.remove(str);
            }
        }
    }

    public a b(String str) {
        if (TextUtils.isEmpty(str)) {
            return null;
        }
        a aVar;
        synchronized (this.b) {
            aVar = (a) this.b.get(str);
        }
        return aVar;
    }
}
